#include <cwchar>
#include "RecordBuffer.h"


RecordBuffer::RecordBuffer(int buffersize) {
    buffer = new Byte *[2];
    for (int i = 0; i < 2; ++i) {
        buffer[i] = new Byte[buffersize];
    }
}

RecordBuffer::~RecordBuffer() {
    for (int i = 0; i < 2; ++i) {
        delete buffer[i];
    }
    delete buffer;
}


Byte *RecordBuffer::getRecordBuffer() {
    index ++;
    if (index > 1){
        index = 1;
    }
    return buffer[index];
}


Byte *RecordBuffer::getNowBuffer() {
    return buffer[index];
}